<template>
  <div class="footer">
    <div class="bg-img">
      <div class="left-box">
        <img :src="leftImg" alt="" ref="left-img">
      </div>
      <div class="center-box" ref="center-img">
        <img :src="centerImg" alt="">
      </div>
      <div class="right-box" ref="right-img">
        <img :src="rightImg" alt="">
      </div>
    </div>
    <div class="title">
      <img width="20" src="../../assets/images/img1.png" alt="">
      <a href="http://www.jzcyyjy.com" target="_blank"> 重庆现代建筑产业发展研究院</a>
    </div>
    <ul>
      <li v-for="item in linksList">
        <a :href="item.linkValue" target="_blank">{{item.linkLabel}}</a>
      </li>
    </ul>
    <div class="title2">
      <img width="30" src="../../assets/images/img2.png" alt="">
      <a href="http://yzs.cqsqcd.com/" target="_blank">营造司建筑产业服务管家</a>
    </div>
  </div>
</template>

<script>
import { getDicts } from '../../api/system/dict/data'
import { screenWidth } from '@/utils/utils'

export default {
  name: "index",
  props:{
    cityCode:String,
    linksList:Array,
  },
  data(){
    return {
      footer_img: require("../../assets/images/footer_bg.png"),
      leftImg:require('@/assets/images/左2.png'),
      centerImg:require('@/assets/images/中2.png'),
      rightImg:require('@/assets/images/右2.png'),
    }
  },
  created() {


  },
  mounted() {
    if(localStorage.getItem('width')){
      this.$refs['center-img'].style.width = localStorage.getItem('width') + 'px'
    }
    if(localStorage.getItem('besideWidth')){
      this.$refs['left-img'].style.width = localStorage.getItem('besideWidth') + 'px'
      this.$refs['right-img'].style.width = localStorage.getItem('besideWidth') + 'px'
    }
  },
  methods: {
    setWidth(width) {
      this.$refs['center-img'].style.width = width + 'px'
      this.$refs['left-img'].style.width = (screenWidth() - width) / 2 + 25 + 'px'
      this.$refs['right-img'].style.width = (screenWidth() - width) / 2 + 25 + 'px'
    },
  }
}
</script>

<style scoped lang="scss">
.bg-img{
  height: 1.1rem;
  position: absolute;
  bottom: 0;
  width: 100%;
  img{
    width: 100%;
  }
  .left-box{
    position: absolute;
    left: 0;
    bottom: 0;
    img{
      height: 43px;
    }
  }
  .center-box{
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    img{
      width: 100%;
      height: 50px;
    }
  }
  .right-box{
    position: absolute;
    right: 0;
    bottom: 0;
    img{
      height: 43px;
    }
  }
}
.footer {
  height: 1rem;
  background-size: 100% 100%;

  position: absolute;
  width: 100%;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  .title{
    position: absolute;
    left: 1rem;
    font-size: 0.3rem;
    color: #fff;
    top: 40%;;
    display: flex;
    align-items: center;
    img{
      margin-right: 5px;
    }
  }
  .title2{
    position: absolute;
    right: 1rem;
    font-size: 0.3rem;
    color: #fff;
    top: 40%;
    display: flex;
    align-items: center;
  }
  a{
    color: #fff;
    text-decoration: none;
  }
  ul{
    display: flex;
    width: 35%;
    justify-content: space-between;
    align-items: center;
    li{
      list-style: none;
      font-size: .2rem;
      position: relative;
      text-align: center;
      height: .5rem;
      line-height: .5rem;
      padding: 0 .2rem;
      //溢出隐藏
      overflow: hidden;text-overflow:ellipsis;white-space: nowrap;
      &:hover{
        a{
          color: #f4e925;

          &::after{
            border-color: #f4e925;
            opacity: 1;
          }
          &::before{
            border-color: #f4e925;
            opacity: 1;
          }
        }
        &::after{
          border-color: #f4e925;
          opacity: 1;
        }
        &::before{
          border-color: #f4e925;
          opacity: 1;
        }
      }
      a{
        position: relative;
        display: inline-block;
        width: 100%;
        height: 100%;
        padding: 0 .2rem;
        font-size: 0.28rem;
        overflow: hidden;text-overflow:ellipsis;white-space: nowrap;
        &::before{
          position: absolute;
          width: .3rem;
          height: .2rem;
          opacity: .4;
          content: "";
          border-left: 2px solid #02a6b5;
          border-bottom: 2px solid #02a6b5;
          bottom: -1px;
          left: -1px;
          border-radius: 2px;
        }
        &::after{
          position: absolute;
          width: .3rem;
          height: .2rem;
          opacity: .4;
          content: "";
          border-right: 2px solid #02a6b5;
          border-bottom: 2px solid #02a6b5;
          bottom: -1px;
          right: -1px;
          border-radius: 2px;
        }
      }
      &::before{
        position: absolute;
        width: .3rem;
        height: .2rem;
        opacity: .4;
        content: "";
        border-top: 2px solid #02a6b5;
        border-left: 2px solid #02a6b5;
        top: -1px;
        left: .2rem;
        border-radius: 2px;
      }
      &::after{
        position: absolute;
        width: .3rem;
        height: .2rem;
        opacity: .4;
        content: "";
        border-top: 2px solid #02a6b5;
        border-right: 2px solid #02a6b5;
        top: -1px;
        right:.2rem;
        border-radius: 2px;
      }
    }
  }
}
</style>
